//
//  DataDetailViewController.m
//  UHealth
//
//  Created by liliang on 15/2/11.
//  Copyright (c) 2015年 gjtx. All rights reserved.
//

#import "DataDetailViewController.h"
#import "ChartView.h"
#import "BodyTemperatureObj.h"
#import "NSString+BloodSugar.h"

@interface DataDetailViewController ()

@property (weak, nonatomic) IBOutlet UILabel        *titleLabel;
@property (weak, nonatomic) IBOutlet UIView         *chartBgView;
@property (nonatomic, strong)ChartView              *chartView;

@end

@implementation DataDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
//    NSString *dateStr = [NSString stringWithFormat:@"%@ -- %@",[NSString stringFromDate:((BodyTemperatureObj *)self.dataArrray[0]).measureDate],[NSString stringFromDate:((BodyTemperatureObj *)[self.dataArrray lastObject]).measureDate]];
    self.titleLabel.text = @"test";
}

- (void)refreshView
{
    [self.chartView refreshViewWithDataArray:self.dataArrray];
}

- (void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    if (!self.chartView) {
        self.chartView = [[ChartView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 280) dataArray:self.dataArrray];
        [self.chartBgView addSubview:self.chartView];
        self.chartBgView.userInteractionEnabled = YES;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
